import request from '@/utils/request'

// 查询卖家店铺列表
export function listSellerStoreEmpower(query) {
  return request({
    url: '/shop/seller/sellerStoreEmpower/list',
    method: 'get',
    params: query
  })
}

// 查询已有的所有店铺列表
export function listSellerStoreRecord(query) {
  return request({
    url: '/seller/store/record/list',
    method: 'get',
    params: query
  })
}

// 查询卖家店铺授权详细
export function getSellerStoreEmpower(id) {
  return request({
    url: '/shop/seller/sellerStoreEmpower/' + id,
    method: 'get'
  })
}

// 新增卖家店铺授权
export function addSellerStoreEmpower(data) {
  return request({
    url: '/shop/seller/sellerStoreEmpower',
    method: 'post',
    data: data
  })
}

// 修改卖家店铺授权
export function updateSellerStoreEmpower(data) {
  return request({
    url: '/shop/seller/sellerStoreEmpower',
    method: 'put',
    data: data
  })
}

// 删除卖家店铺授权
export function delSellerStoreEmpower(id) {
  return request({
    url: '/shop/seller/sellerStoreEmpower/' + id,
    method: 'delete'
  })
}

// 获取该店铺当前所拥有的分类
export function queryStoreSubCategory(query) {
  return request({
    url: '/shop/system/sellerStoreSubcategory/queryStoreSubCategory',
    method: 'get',
    params: query
  })
}

// 获取系统内一级分类
export function selectTopList() {
  return request({
    url: '/gather/gather/collectProductCategory/selectTopList',
    method: 'get'
  })
}

// 用户选择店铺所在分类
export function chooseStoreSubCategory(data) {
  return request({
    url: '/shop/system/sellerStoreSubcategory/chooseStoreSubCategory',
    method: 'post',
    data: data
  })
}

// 修改店铺密码
export function updateStorePassWord(data) {
  return request({
    url: '/shop/seller/sellerStoreEmpower/updateStorePassWord',
    method: 'get',
    params: data
  })
}

// 添加cookie
export function addCookie(data) {
  return request({
    url: '/shop/seller/sellerStoreCookie',
    method: 'post',
    data: data
  })
}

// 修改cookie
export function editCookie(data) {
  return request({
    url: '/shop/seller/sellerStoreCookie',
    method: 'put',
    data: data
  })
}

// 获取erp用户下已授权的店铺列表
export function queryUserShopList() {
  return request({
    url: '/shop/seller/sellerStoreEmpower/selectList',
    method: 'get'
  })
}

// 店铺cookie查询
export function queryCookieInd(data) {
  return request({
    url: '/shop/seller/sellerStoreCookie/getInfoByStoreId',
    method: 'get',
    params: data
  })
}

// 根据店铺id，获取店铺授权类目
export function querySubCategoryListByStoreId(data) {
  return request({
    url: '/shop/system/sellerStoreSubcategory/querySubCategoryListByStoreId',
    method: 'get',
    params: data
  })
}

// 根据CN码获取店铺ID
export function getIdByStoreUserName(data) {
  return request({
    url: '/seller/sellerStoreEmpower/getIdByStoreUserName',
    method: 'post',
    data: data
  })
}

// 根据CN码关联店铺
export function bindShop(data) {
  return request({
    url: '/shop/seller/sellerStoreEmpower/bindShop',
    method: 'post',
    data
  })
}


// 根据CN码解绑店铺
export function unbindShop(data) {
  return request({
    url: '/shop/seller/sellerStoreEmpower/unbindShop',
    method: 'get',
    params: data
  })
}
